/*
 *  Copyright (c)  09.04.2007 Philipp Marx.
 *  Permission is granted to copy, distribute and/or modify this document
 *  under the terms of the GNU Free Documentation License, Version 1.2
 *  or any later version published by the Free Software Foundation;
 *  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
 *  A copy of the license is included in the section entitled "GNU
 *  Free Documentation License".
 */

package de.smigfu.irc.handler;

import de.smigfu.irc.core.IRCServerConnection;

/**
 * A <code>MessageHandler</code> handles a message received from an IRC-server. Every handler gets
 * the chance to react on every received message.
 * A <code>MessageHandler</code> is an "observer" on an <code>IRCServerConnection</code>.
 *
 * @version $Revision$ $Date$
 *
 * @author Philipp Marx, last modified by $Author$
 */
public interface MessageHandler {

   /**
    * Upon notification about a received message from the <code>IRCServerConnection</code> this
    * method is invoked.
    * 
    * @param connection The <code>IRCServerConnection</code> which received the message (the subject).
    * @param message The received message.
    */
   public abstract void handleMessageReceived(IRCServerConnection connection, Message message);

   /**
    * Upon notification about a sent message from the <code>IRCServerConnection</code> this
    * method is invoked.
    * 
    * @param connection The <code>IRCServerConnection</code> which received the message (the subject).
    * @param message The received message.
    */
   public abstract void handleMessageSent(IRCServerConnection connection, Message message);
}
